<?php

/*
Bank Interest (admin_bank_interest.pro.php)
*/

$page_title = "Set Bank Interest";
$rank_check = 7;
include "../global.inc.php";

$interestUsername = strtolower(ereg_replace(" ", "", $interestUsername));
$findUsername = fetch("SELECT * FROM members2 WHERE username = '$interestUsername' AND game = '$game'");

$interestRate2 = $interestRate / 100 + 1;

$findInterest = fetch("SELECT * FROM bank2 WHERE user = '$findUsername[id]' AND game = '$game'");

if ($findInterest[id])
{
	mysql_query("UPDATE bank2 SET rate = '$interestRate2' WHERE user = '$findUsername[id]' AND game = '$game'");
}
if (!$findInterest[id])
{
	mysql_query("INSERT INTO bank2 (user,points,rate,game) VALUES ('$findUsername[id]','100','$interestRate2','$game')");
}

systemmessage("$game", "bank.php?game=$game", "$findUsername[id]", "An admin has set your bank interest to $interestRate%");

header(error("admin_bank_interest.php?game=$game","$interestUsername bank interest has been set to $interestRate%"));

?>
